N = 5;

fileName = strcat('traps',num2str(N),'.dat');

[theta, phi] = loadTrapData(fileName);

[x,y,z] = fromSphToCart(1, theta, phi);

plot3(x,y,z,'rs','Markersize',15);
sphere;
axis equal;
hold on;
plot3(x,y,z,'rs','Markersize',15,'Markerfacecolor','black');
hold off;



trapEnergy(x,y,z)